package io.adrainty.demo.seata.storage.web;

import io.adrainty.demo.seata.storage.service.IStorageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>StorageController</p>
 *
 * @author AdRainty
 * @version V1.0.0
 * @description StorageController
 * @since 2025/8/20 14:00:40
 */

@RestController
@RequestMapping("/storage")
public class StorageController {

    @Resource
    private IStorageService storageService;

    @GetMapping("/shop")
    public Boolean shop(@RequestParam("accountNo") String accountNo,
                        @RequestParam("productId") Long productId,
                        @RequestParam("skuId") Long skuId,
                        @RequestParam("count") Integer count) {
        return storageService.doShop(accountNo, productId, skuId, count);
    }

}
